import 'package:fl_demo/src/auto_size_text/row_auto_size_text.dart';
import 'package:flutter/material.dart';
import 'package:universally/universally.dart';

class AutoSizeTextPage extends StatelessWidget {
  const AutoSizeTextPage({super.key});

  @override
  Widget build(BuildContext context) {
    final center = Padding(
      padding: const EdgeInsets.symmetric(horizontal: 4),
      child: Icon(Icons.swap_horizontal_circle_outlined, size: 16),
    );

    return BaseScaffold(
      appBarTitleText: 'AutoSizeText',
      spacing: 20,
      padding: 20.edgeInsetsAll,
      children: [
        Card(
          child: Universal(
            spacing: 10,
            width: double.infinity,
            padding: EdgeInsets.all(20),
            crossAxisAlignment: CrossAxisAlignment.start,
            children: [
              RowAutoSizeText(leading: '1111', trailing: '22222', center: center, centerWidth: 24),
              RowAutoSizeText(leading: '11111111111111111111111111', trailing: '2222222', center: center, centerWidth: 24),
              RowAutoSizeText(leading: '11111', trailing: '22222222222222222222222222', center: center, centerWidth: 24),
              RowAutoSizeText(
                leading: '11111111111111111111111111',
                trailing: '22222222222222222222222222',
                center: center,
                centerWidth: 24,
              ),
            ],
          ),
        ),
      ],
    );
  }
}
